package com.cotx.userconsumer01.controller;


import com.cotx.userinterface.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    //查询全部用户数据，显示列表
    @GetMapping("/")
    public String findAll(Model model){

        Map<String, Object> map = userService.findAll();
        model.addAttribute("page",map.get("list"));
       model.addAttribute("version",map.get("version"));

        System.out.println("version:"+map.get("version"));
        return "user/list";
    }
}
